<% #endcoding:utf-8%>
<% @question=Question.find(answer.question_id)%>
<li class="list-group-item">
  <p class="timeago"><a href="/usercard/<%=answer.user_id%>">
        <%=avatar(User.find(answer.user_id),'img-circle img-small')%>
      </a>
      <%=getname(answer.user_id)%>.<%=time_ago_in_words(answer.created_at)%>以前-<%=link_to '问题#'+@question.id.to_s,question_path(@question),:class => 'timeago'%></p>
          <p><%=answer.content.html_safe%></p>

  <div class="operations">
    <span class="glyphicon glyphicon-thumbs-up" onclick="good(<%=!session[:user_id].nil? ? session[:user_id]:0%>,<%=answer.user_id%>,<%=answer.id%>,<%=answer.question_id%>,this)"></span>
    (<span class="praise-num"><%=answer.praises.count%></span>)
    <%if !session[:user_id].nil? %>
        <%if current_user?(@question.user_id) && !@question.fixed%>
    <a href="/questions/<%=@question.id%>/adopt/<%=answer.id%>" alog-action="qb-adopt-ask" hidefocus="true" class="btn-adopt-ask grid" id="adopt-ask-2353676780" data-log="type:2060,action:click,area:adopt-ask,page:qb">
      采纳答案</a>
        <%end%>
        <%if answer.adopted?%>
        <span class="glyphicon glyphicon-ok"></span>采纳
        <%end%>
    <%end%>
  </div>
</li>